<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>

<%@ page import="com.conversationboard.model.*"%>
<%@ page import="com.conversationboard.view.*"%>
<%@ page import="com.conversationboard.config.*"%>

<%@ page pageEncoding="UTF-8"%>
<%@ page contentType="text/html;charset=UTF-8"%>

<%
	String userId = request.getUserPrincipal().getName();
	User user = User.get(userId);
	String root = Configuration.getInstance().getRoot();
	request.setAttribute("user", user);
	request.setAttribute("root", root);
%>

<html>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Admin Menu</title>
<link rel="stylesheet" type="text/css" href="<%=Configuration.getInstance().getRoot()%>/Stylesheets/<%=StyleSheets.getStyleSheetFileName(request.getCookies())%>">
</head>

<%=MainMenu.display(request.getUserPrincipal())%>

<body>

<div class="headingblock">
<h1>Administration Menu</h1>
</div>

<div class="mainblock">

<div class="formsectionlight">

<c:if test="${user.siteAdmin}">

	<fieldset class="cell"><LEGEND>Big red switches</LEGEND>
	<table cellpadding="8" frame="box" rules="all">
		<tr class="row">
			<td><a href="${root}/Pages/Admin/openclose.jsp">Open or Close Site</a></td>
			<td><a href="${root}/Pages/Admin/sitemessage.jsp">Site Administration Message</a></td>
		</tr>
	</table>
	</fieldset>
	<br />
	<br />

	<fieldset class="cell"><LEGEND>Bans</LEGEND>
	<table cellpadding="8" frame="box" rules="all">
		<tr class="row">
			<td><a href="${root}/Admin/AdminViewBanRequestsControllerServlet">View Ban Requests</a></td>
			<td><a href="${root}/Pages/Admin/ban.jsp">Ban Range</a></td>
			<td><a href="${root}/Pages/Admin/unban.jsp">Review Site Bans</a></td>
			<td><a href="${root}/Pages/Admin/Reports/recent-suggest-bans.jsp">Recent Flagged Posts</a></td>
		</tr>
	</table>
	</fieldset>
	<br />
	<br />

	<fieldset class="cell"><LEGEND>User controls</LEGEND>
	<table cellpadding="8" frame="box" rules="all">
		<tr class="row">
			<td><a href="${root}/Pages/Admin/pendingregistrations.jsp">View Pending Registrations</a></td>
			<td>&nbsp;</td>
			<td>&nbsp;</td>
		</tr>
		<tr class="row">
			<td><a href="${root}/Admin/AdminSockpuppetReportServlet">Sockpuppet Report</a></td>
			<td><a href="${root}/Pages/Admin/identify-user-by-email.jsp">Identify User by Email Address</a></td>
			<td><a href="${root}/Pages/Admin/Reports/yellowcard-report.jsp">See Historical Yellowcard Information</a></td>
		</tr>
		<tr class="row">
			<td><a href="${root}/Pages/Admin/removeuser.jsp">Remove a User</a></td>
			<td><a href="${root}/Admin/AdminPreCreateInterestGroupControllerServlet">Create Interest Group</a></td>
			<td>&nbsp;</td>
		</tr>
	</table>
	</fieldset>
	<br />
	<br />

	<fieldset class="cell"><LEGEND>Admins</LEGEND>
	<table cellpadding="8" frame="box" rules="all">
		<tr class="row">
			<td><a href="${root}/Pages/Admin/newboardadmin.jsp">Create New Board Admin</a></td>
			<td><a href="${root}/Pages/Admin/newsiteadmin.jsp">Create New Site Admin</a></td>
			<td><a href="${root}/Pages/Admin/revokeprivileges.jsp">Revoke Admin Privileges</a></td>
		</tr>
	</table>
	</fieldset>
	<br />
	<br />

	<fieldset class="cell"><LEGEND>Site information</LEGEND>
	<table cellpadding="8" frame="box" rules="all">
		<tr class="row">
			<td><a href="${root}/Admin/AdminShowLogControllerServlet?type=ALL">View Log</a></td>
			<td><a href="${root}/PerformanceStatsControllerServlet">Performance Statistics</a></td>
			<td><a href="${root}/Pages/Admin/siteinfo.jsp">Site Info</a></td>
			<td><a href="${root}/Admin/AdminBatchJobStatusControllerServlet">Batch Job Status</a></td>
		</tr>
	</table>
	</fieldset>
	<br />
	<br />

	<fieldset class="cell"><LEGEND>Configuration</LEGEND>
	<table cellpadding="8" frame="box" rules="all">
		<tr class="row">
			<td><a href="${root}/Pages/Admin/substitutions.jsp">Substitutions</a></td>
			<td><a href="${root}/Pages/Admin/boardstructure.jsp">Board Structure</a></td>
			<td><a href="${root}/Admin/AdminEditSiteConfigurationServlet">Edit Site Configuration</a></td>
		</tr>
		<tr class="row">
			<td><a href="${root}/Pages/Admin/confirm.jsp?action=reindexalldocuments">Recreate Search Index</a></td>
			<td><a href="${root}/Pages/Admin/allowregistrations.jsp">Change Site Registration Status</a></td>
			<td>&nbsp;</td>
		</tr>
	</table>
	</fieldset>
	<br />
	<br />

	<fieldset class="cell"><LEGEND>Cache control</LEGEND>
	<table cellpadding="8" frame="box" rules="all">
		<tr class="row">
			<td><a href="${root}/Pages/Admin/clearcaches.jsp">Clear Caches</a></td>
			<td><a href="${root}/Admin/AdminCacheSizesControllerServlet">Cache Sizes</a></td>
			<td><a href="${root}/Admin/AdminStoreVotesControllerServlet">Store Vote Cache</a></td>
		</tr>
	</table>
	</fieldset>
	<br />
	<br />

</c:if> <br />

<c:if test="${user.admin and not user.siteAdmin}">
	<table class="table">

		<tr class="header">
			<td class="cell">Board Admin Menu</td>
		</tr>

		<tr class="row">
			<td class="cell"><a href="${root}/Pages/Admin/unban.jsp">Review Site Bans</a></td>
		</tr>
		<tr class="row">
			<td class="cell"><a href="${root}/Pages/Admin/siteinfo.jsp">Site Info</a></td>
		</tr>
	</table>
</c:if></div>
</div>

<!--<script src="http://www.google-analytics.com/urchin.js" type="text/javascript"></script>-->
<!--<script type="text/javascript">_uacct = "UA-1148679-1";urchinTracker();</script>-->

</body>

</html>
